﻿@model PortalCurriculo.MvcWebUI.Models.CurriculoModel
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script type="text/javascript">
    $(function () {
        $("#editFormCurriculo").dialog({ autoOpen: false, modal: true, resizable: false });
    });

    function onSuccessCurriculo() {
        $("#editFormCurriculo").dialog('close');
    };

    function onErrorCurriculo(){
        $("#erroCurriculo").show();
    };
</script>
@{
    Html.EnableClientValidation();
}
@using (Ajax.BeginForm("Manter", new AjaxOptions { UpdateTargetId = "listaCurriculos", OnSuccess = "onSuccessCurriculo", OnFailure = "onErrorCurriculo" }))
{
    <span class="displayNone error" id="erroCurriculo">@PortalCurriculo.MvcWebUI.Resources.Curriculo.Geral.ObjetivoDuplicado</span>
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>@PortalCurriculo.MvcWebUI.Resources.Curriculo.Geral.Curriculo</legend>
        @if (Model != null )
        {
            Html.HiddenFor(model => model.Id);
            Html.HiddenFor(model => model.IdProfissional);
        }

        <div class="editor-label">
            @Html.LabelFor(model => model.Objetivo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Objetivo)
            <div class="editor-field">
                @Html.ValidationMessageFor(model => model.Objetivo)
            </div>
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ArquivoDOC)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ArquivoDOC)
            @Html.ValidationMessageFor(model => model.ArquivoDOC)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdNivelProfissional)
        </div>
        <div class="editor-field">
            @Html.DropDownList("IdNivelProfissional", (SelectList)ViewBag.IdNivelProfissional, new { style = "width: 200px" })
            @Html.ValidationMessageFor(model => model.IdNivelProfissional)
        </div>
       
        @*@Html.Action("Selecionar", "Cargo", new { idCargo=3 } )*@

        <div class="editor-label">
            @Html.LabelFor(model => model.CartaApresentacao)
        </div>
        <div class="editor-field">
            @Html.TextAreaFor(model => model.CartaApresentacao)
            <div class="editor-field">
                @Html.ValidationMessageFor(model => model.CartaApresentacao)
            </div>
        </div>

        <p>
            <input type="submit" value="@PortalCurriculo.MvcWebUI.Resources.Geral.Botoes.Salvar" class="buttonSave ui-button ui-widget ui-state-default ui-corner-all"  />
            <input type="button" onclick="$('#editFormCurriculo').dialog('close');" value="@PortalCurriculo.MvcWebUI.Resources.Geral.Botoes.Cancelar" class="buttonCancelar ui-button ui-widget ui-state-default ui-corner-all" />
        </p>
    </fieldset>
}
